<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateYsRechargeTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('recharge', function(Blueprint $table)
		{
			$table->increments('id')->comment('主键id');
			$table->bigInteger('uid')->comment('用户id');
			$table->string('out_trade_no', 32)->nullable()->unique()->comment('订单编号');
			$table->integer('recharge_time')->nullable()->comment('充值时间');
			$table->tinyInteger('type')->nullable()->default(0)->comment('充值类型1为支付宝2为微信');
			$table->string('subject')->nullable()->comment('充值项目1为充值言士币');
			$table->float('amount', 10)->nullable()->default(0.00)->comment('充值金额');
			$table->integer('coin_count')->nullable()->default(0)->comment('充值数量');
			$table->tinyInteger('status')->nullable()->default(2)->comment('充值状态1为成功2为待支付3为失败');
			$table->string('trade_no', 48)->nullable()->comment('支付宝或者微信订单编号');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('recharge');
	}

}
